package com.anytron.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.anytron.model.TimerLogs;
import com.anytron.model.req.PageRequest;
import com.anytron.model.res.ResultData;
import com.anytron.service.TimerLogsService;
import com.github.pagehelper.PageInfo;


@RestController
@RequestMapping(value = "app/timer/logs")
public class TimerLogController {
	
	@Autowired
	TimerLogsService timerLogsService;
	
	@RequestMapping(value = "list")
	public ResultData<PageInfo<TimerLogs>> list(PageRequest pageRequest,TimerLogs timerLogs) throws Exception {
		ResultData<PageInfo<TimerLogs>> resultData = new ResultData<>();
		PageInfo<TimerLogs> pageInfo = timerLogsService.queryDataByPage(pageRequest, timerLogs);
		resultData.setData(pageInfo);
		resultData.setErrorCode(0);
		resultData.setSuccess(true);
		return resultData;
	}
	
}
